package cn.com.dingtek.genius.manager.server.utils;

import org.joda.time.DateTime;

public abstract class DateTimeUtil {
    public static final String yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss";
    public static final String yyyyMMddHHmmss2 = "yyyyMMdd_HHmm";
    public static final String yyyyMMdd = "yyyyMMdd";
    public static final String yyyyMMddHH = "yyyyMMddHH";

    public static DateTime maxOfDay(DateTime dateTime) {
        return dateTime.millisOfDay().withMaximumValue();
    }

    public static DateTime minOfDay(DateTime dateTime) {
        return dateTime.millisOfDay().withMinimumValue();
    }

    public static DateTime minOfMonth(DateTime dateTime) {
        return dateTime.dayOfMonth().withMinimumValue();
    }

    public static DateTime maxOfMonth(DateTime dateTime) {
        return dateTime.dayOfMonth().withMaximumValue();
    }
}
